import request from "@/utils/request";

export function fetchList(query) {
    return request({
        url: "/device/api/assetField/query/list",
        method: "get",
        params: query
    });
}

//批量处理数据
export function saveInfo(query) {
    let params = query.map(item => {
        if (item.fieldType == "organization") {
            item.fieldRuleType = "-";
        }
        return item;
    });

    return request({
        url: "/device/api/assetField/batch",
        method: "put",
        data: params
    });
}
//设备详细信息
export function fetchDetailInfo(query) {
    return request({
        url: "/device/api/device/query/" + query,
        method: "get"
    });
}
//导出
export function exportFile(params) {
    return request({
        url: "/device/api/device/exportExcel",
        method: "get"
    });
}
//下载批量导入模板

export function downloadTemplete(query) {
    return request({
        url: "/minio/minio/outSideChain",
        method: "get",
        params: query
    });
}
//删除台账
export function deleteDeviceInfo(query) {
    return request({
        url: "/user/api/user/" + query,
        method: "delete"
            //data: query
    });
}
//启用
export function startUserInfo(query) {
    return request({
        url: "/user/api/user/start/" + query,
        method: "put"
            //data: query
    });
}
//停用
export function stopUserInfo(query) {
    return request({
        url: "/user/api/user/stop/" + query,
        method: "put"
            //data: query
    });
}